<!-- 侧边菜单栏 -->
<template>
  <div id="side-menu-group">
    <div class="side-box">
      <div class="menu-box" v-for="(item, i) in lists" :key="i" @mouseenter="item.flag=!item.flag" @mouseleave="item.flag=!item.flag">
        <router-link :to="item.menuPath">
          <div class="menu-icon-box">
            <img v-show="!item.flag" class="menu-icon" :src="item.gregIcon" alt="">
            <img v-show="item.flag" class="menu-icon" :src="item.whiteIcon" alt="">
            <div class="menu-widen-box">{{ item.menuName }}</div>
          </div>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'side-menu-group',
  el: '#side-menu-group',
  components: {
  },
  props: ['lists'],
  data () {
    return {
    }
  },
  computed: {
  },
  methods: {
  }
}
</script>

<style scoped>
  #side-menu-group {
    height: 100%;
    width: auto;
    position: fixed;
    z-index: 98;
    background-color: #252a2f;
    padding-top: 50px;
  }

  .side-box {
    height: 100%;
    width: 50px;
    border-top: 1px solid hsla(0,0%,100%,.1);
    transition: width 0.5s;
    -moz-transition:width 0.5s; /* Firefox 4 */
    -webkit-transition:width 0.5s; /* Safari and Chrome */
    -o-transition:width 0.5s; /* Opera */
  }

  .side-box:hover {
    width: 220px;
  }

  .side-box:hover .menu-widen-box{
    opacity: 1;
    visibility: visible;
  }

  .menu-box {
    height: 50px;
    width: 100%;
    position: relative;
  }

  .menu-icon-box {
    height: 50px;
    width: auto;
  }

  .menu-box:hover {
    background-color: #192129;
  }

  .menu-box:hover .menu-widen-box{
    color: #00c1de;
  }

  .menu-icon {
    height: 50px;
    width: 50px;
    padding: 15px;
    float: left;
  }

  .menu-widen-box {
    height: 100%;
    width: 100%;
    float: left;
    color: white;
    font-size: 12px;
    font-weight: normal;
    line-height: 50px;
    text-align: left;
    position: absolute;
    padding-left: 50px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s;
    -moz-transition: all 0.5s; /* Firefox 4 */
    -webkit-transition: all 0.5s; /* Safari and Chrome */
    -o-transition: all 0.5s; /* Opera */
  }
</style>
